package com.linfeng.component.oauth2.tools;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.extra.spring.SpringUtil;
import cn.hutool.http.HttpUtil;
import com.linfeng.component.oauth2.config.ResourceServerConfig;

public class TokenTools {

    public static String parse(String token) {
        ResourceServerConfig config = SpringUtil.getBean(ResourceServerConfig.class);
        String result = HttpUtil.post(config.getTokenCheckAddress() + ResourceServerConfig.TOKEN_CHECK_PATH, MapUtil.<String, Object>of("token", token));

        return result;
    }
}
